-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Register gRPC Gateway routes #7173
Conversation
…21-grpc-gateway-follow-up
…21-grpc-gateway-follow-up
Codecov Report
@@ Coverage Diff @@
## master #7173 +/- ##
==========================================
+ Coverage 54.04% 54.77% +0.72%
==========================================
Files 415 565 +150
Lines 30163 39134 +8971
==========================================
+ Hits 16301 21434 +5133
- Misses 12557 15932 +3375
- Partials 1305 1768 +463 |
}{ | ||
{ | ||
"gRPC total account balance", | ||
fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s", baseURL, base64.URLEncoding.EncodeToString(val.Address)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the address
path in the URL is defined as bytes in the proto files, and grpc-gateway decodes bytes with base64.URLEncoding, we (actually, any HTTP client really) need to encode the address as base64 URLEncoding first.
This has the unfortunate consequence of showing non-human-readable addresses in URLs:
+ /cosmos/bank/v1beta1/balances/u1-UOH-CHOvM2rNadSjtNARKkSk= // with base64
- /cosmos/bank/v1beta1/balances/cosmos1hd0egwrlsgwwhnx6kdd8228dxszy4yffnv2gtu // expected
What do people think here? Are you okay to use base64-encoded addresses in URLs?
If not, it's maybe worth to raise an issue on grpc-gateway to see if we can customize bytes decoding.
…21-grpc-gateway-x-auth-routes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm 👍
Could you rename the PR title to reflect the modules you changed in this PR? |
Added all the addressed modules in description part of the PR. |
ref: #5921
follow-up: #7019
Description
closes: #XXXX
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes